﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sinacor.Infra.Common;
using Sinacor.Infra.UI.Common;
using Sinacor.UI.Bovespa.Ordens.Model;
using System.ComponentModel;
using Sinacor.UI.Bovespa.Ordens.Communication.Bovespa.Cliente.Cliente;

namespace Sinacor.UI.Bovespa.Ordens.Communication.Translator
{
    class TranslatorEndereco : 
    BaseTranslator<Model.Endereco, 
    EnderecoResponse, 
    ModelCollection<Model.Endereco>,
    List<EnderecoResponse>>
{
    public override Model.Endereco Translate(EnderecoResponse from)
    {
        Model.Endereco to = new Model.Endereco();
        if (from != null)
        {
           
            TranslatorEnumTipoEndereco tipoEndereco = new TranslatorEnumTipoEndereco();
            Model.Enum.TipoEndereco tipoEnderecoEnum = new Model.Enum.TipoEndereco();
            tipoEndereco.TranslateEnum(from.Tipo, out tipoEnderecoEnum);
            to.Tipo = tipoEnderecoEnum;
            to.Rua = from.Rua;
            to.Numero = from.Numero;
            to.CEP = from.CEP;
            to.Complemento = from.Complemento;
            to.Bairro = from.Bairro;
            to.Cidade = from.Cidade;
            to.UF = from.UF;
            to.Email = from.Email;
        }
        return to;
    }
}
}



